import { createApp } from "vue";
import { createPinia } from "pinia";
// 导入 element-plus
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/dist/index.css";
// @ts-ignore
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

import router from "./router";

import * as TarotDirective from "@/directive/index";
import Tarot from "@/Tarot.vue";

const app = createApp(Tarot);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

for (const [, directive] of Object.entries(TarotDirective)) {
  directive.forEach((item) => {
    app.use(item);
  });
}

app
  .use(ElementPlus, { locale: zhCn })
  .use(createPinia())
  .use(router)
  .mount("#tarot");
